package org.bookie.framework.mails;

import java.util.List;

import org.apache.hivemind.ApplicationRuntimeException;
import org.apache.tapestry.IExternalPage;
import org.apache.tapestry.IRequestCycle;
import org.apache.tapestry.html.BasePage;
import org.bookie.framework.Bookie;

public abstract class CommonMailPage extends BasePage implements IExternalPage{
	
	/**
	 * {@inheritDoc}
	 */
	public void activateExternalPage(Object[] parameters, IRequestCycle cycle) {
		List names = getSpecification().getPropertySpecificationNames();
		if (parameters.length!=names.size()) {
            throw new ApplicationRuntimeException(
            			getMessages().format("page-parameters-missing", getPageName(), Bookie.listToString(names)));
		}
	}

}
